var $container = $('#content');
$container.imagesLoaded(function(){
  $container.masonry({
    itemSelector : '.message',
    columnWidth : 240
  });
});

$(window).scroll(function () {
      var clienth = document.documentElement.clientHeight;
      var scrollh = document.documentElement.scrollHeight;
      var scrollt = document.documentElement.scrollTop + document.body.scrollTop;
      if (clienth + scrollt + 200 > scrollh) {
        $.post("http://localhost/google/2012-2-10-graduate/branches/doitphp/index.php/ajax/tengxun", 
          function(data) {
          // $("#content").append(data);
          var $container = $('#content');
          var el = $(data);
          $("#content").append(el).masonry( 'appended', el, true );
         
        });
      }
    });
